Nowadays, epub format, as a standardly and globally accepted e-book format, has a more favorable reception. Compared with the printed documents, most people prefer to
share more documents electronically, which is convenient and can save much time
and money. Thus, converting word to epub becomes necessary and increasingly
significant to meet people’s needs. Maybe you think you must use word to epub
conversion software to convert word to epub, but for Spire.Doc, you do not need to spend money to use any conversion software.
Spire.Doc allows users to convert word to epub, word to pdf, word to xml, word to tiff image, word to rtf, word to html and so on. Furthermore, Spire. Doc supports .NET and Silverlight platform to perform a wide range of processing tasks directly without Microsoft Office Word installed in the computer. This article aims at teaching people to convert word to epub for C#, VB.NET in Spire.Doc with Visual Studio. Before you start, make sure that Spire.Doc, Visual Studio
and E-book reader are installed in your computer.
Freely Download Spire.Doc
share more documents electronically, which is convenient and can save much time
and money. Thus, converting word to epub becomes necessary and increasingly
significant to meet people’s needs. Maybe you think you must use word to epub
conversion software to convert word to epub, but for Spire.Doc, you do not need to spend money to use any conversion software.
Spire.Doc allows users to convert word to epub, word to pdf, word to xml, word to tiff image, word to rtf, word to html and so on. Furthermore, Spire. Doc supports .NET and Silverlight platform to perform a wide range of processing tasks directly without Microsoft Office Word installed in the computer. This article aims at teaching people to convert word to epub for C#, VB.NET in Spire.Doc with Visual Studio. Before you start, make sure that Spire.Doc, Visual Studio
and E-book reader are installed in your computer.
Freely Download Spire.Doc
Procedure
First, create the Word to EPUB project.
Open Visual Studio (2008 or later)—File—New Project—Visual C#—Console Application. Name Console Application Word to Epub (if you need to create a Visual Basic project, Console Application, you can name the project Word
to EPUB)—OK.
First, create the Word to EPUB project.
Open Visual Studio (2008 or later)—File—New Project—Visual C#—Console Application. Name Console Application Word to Epub (if you need to create a Visual Basic project, Console Application, you can name the project Word
to EPUB)—OK.
Second, add references.
Open Solution Explorer--—Click project —Add Reference—Find "C:\Program Files\e-iceblue\Spire.Doc"(the default folder which you installed the Spire Doc in )— Double-click the folder Bin. If the target framework of the project
Net 2.0, double-click folder NET2.0
or Net 3.5, double-click folder NET3.5
or Net 4.0, double-click folder NET4.0
Select assembly Spire Doc dll —Click OK
Open Solution Explorer--—Click project —Add Reference—Find "C:\Program Files\e-iceblue\Spire.Doc"(the default folder which you installed the Spire Doc in )— Double-click the folder Bin. If the target framework of the project
Net 2.0, double-click folder NET2.0
or Net 3.5, double-click folder NET3.5
or Net 4.0, double-click folder NET4.0
Select assembly Spire Doc dll —Click OK
Third, view the method.
After you create the project Word to EPUB, you can see the code view and the following method has been added automatically:
C#
static void Main(string[] args)
VB.NET
Shared Sub Main(ByVal args() As String)
After you create the project Word to EPUB, you can see the code view and the following method has been added automatically:
C#
static void Main(string[] args)
VB.NET
Shared Sub Main(ByVal args() As String)
Fourth, add the following codes to the top of the file:
C#
using Spire.Doc;
VB.NET
Imports Spire.Doc
C#
using Spire.Doc;
VB.NET
Imports Spire.Doc
Fifth, add the following codes to the method.
C#
static void Main(string[] args)
{
//Create word document
Document doc = new Document();
doc.LoadFromFile(@"..\..\..\..\..\..\Data\DocToEpub.docx",
FileFormat.Docx);
doc.SaveToFile(@"DocToEupb.epub",FileFormat.EPub);
System.Diagnostics.Process.Start(@"DocToEupb.epub");
}
C#
static void Main(string[] args)
{
//Create word document
Document doc = new Document();
doc.LoadFromFile(@"..\..\..\..\..\..\Data\DocToEpub.docx",
FileFormat.Docx);
doc.SaveToFile(@"DocToEupb.epub",FileFormat.EPub);
System.Diagnostics.Process.Start(@"DocToEupb.epub");
}
VB.NET
Shared Sub Main(ByVal args() As String)
'Create word document
Dim doc As New Document()
doc.LoadFromFile("..\..\..\..\..\..\Data\DocToEpub.docx",FileFormat.Docx)
doc.SaveToFile("DocToEupb.epub",FileFormat.EPub)
Process.Start("DocToEupb.epub")
End Sub
End Class
End Namespace
Finally, operate the project Word to EPUB.
In Solution Explorer, right-click the project Word to EPUB —Click Debug—Start new instance, you can see the picture 6.1 shows itself:
Converting word to EPUB for C#, VB.NET in Spire.Doc is an easy and effective way to convert word to epub. Whether you are busy in writing the next bestseller or just plan to read your performance report on the e-book reader, you would never worry about which
conversion software you should buy. Spire.Doc can help you fast convert word document to different file formats without any conversion software. Thus, you can use the reading device such as iPad, iPhone, Sony Reader and so on to view your business documents reports. More details about word conversion .
Source